﻿<UserControl x:Class="OSTWin.ucState"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="155"></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="68"></RowDefinition>
            <RowDefinition Height="32"></RowDefinition>
            <RowDefinition Height="82"></RowDefinition>
            <RowDefinition Height="44"></RowDefinition>
            <RowDefinition Height="112"></RowDefinition>
        </Grid.RowDefinitions>

        <Image Grid.Row="0" Grid.RowSpan="5" Grid.Column="0" Width="155" Height="154" Source="/OSTWin;component/Resources/OST_Medium.jpg"></Image>
        <Grid Grid.Row="0" Grid.Column="1" >
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock Name="Date" Grid.Row="0" Text="{Binding Path=State.Date, StringFormat=Systemdate: {0}}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="Uptime" Grid.Row="1" Text="{Binding Path=State.Uptime, StringFormat=Systemuptime: {0}}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="Version" Grid.Row="2" Text="{Binding Path=State.Version, StringFormat=Systemversion: {0}}" FontWeight="Medium"></TextBlock>
            <Line Stretch="Fill" Grid.Row="3" Stroke="Gray" X2="1"/>
        </Grid>
        <Grid Grid.Row="1" Grid.Column="1" >
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock Name="FreeBytes" Grid.Row="0" Text="{Binding Path=State.FreeBytes, StringFormat=FreeBytes: {0}}" FontWeight="Medium"></TextBlock>
            <Line Stretch="Fill" Grid.Row="1" Stroke="Black" X2="1"/>
        </Grid>
        <Grid Grid.Row="2" Grid.Column="1" >
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock Name="WindSpeed" Grid.Row="0" Text="{Binding Path=State.WindSpeed, StringFormat=WindSpeed: {0} ms}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="WindSpeedAverage" Grid.Row="1" Text="{Binding Path=State.WindSpeedAverage, StringFormat=WindSpeedAverage: {0} ms}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="WindAlarm" Grid.Row="2" Text="{Binding Path=State.TrackingWindAlarm, StringFormat=TrackingWindAlarm: {0}}" FontWeight="Medium"></TextBlock>
            <Line Stretch="Fill" Grid.Row="3" Stroke="Gray" X2="1"/>
        </Grid>
        <Grid Grid.Row="3" Grid.Column="1" >
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock Name="MotorState" Grid.Row="0" Text="{Binding Path=State.MotorState, StringFormat=Motor-State: {0}}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="MotorPosition" Grid.Row="1" Text="{Binding Path=State.MotorPosition, StringFormat=Motor-Position: {0} mm}" FontWeight="Medium"></TextBlock>
            <Line Stretch="Fill" Grid.Row="2" Stroke="Gray" X2="1"/>
        </Grid>
        <Grid Grid.Row="4" Grid.Column="1" >
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock Name="TrackingState" Grid.Row="0" Text="{Binding Path=State.TrackingState, StringFormat=TrackingState: {0} next is:}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="NextTrackingActionTimeStamp" Grid.Row="1" Text="{Binding Path=State.NextTrackingAction.Sunposition.Timestamp, StringFormat=Timestamp: {0}}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="NextTrackingActionAzi" Grid.Row="2" Text="{Binding Path=State.NextTrackingAction.Sunposition.Azimut, StringFormat=Azimut: {0} °}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="NextTrackingActionEle" Grid.Row="3" Text="{Binding Path=State.NextTrackingAction.Sunposition.Elevation, StringFormat=Elevation: {0} °}" FontWeight="Medium"></TextBlock>
            <TextBlock Name="NextTrackingActionTarget" Grid.Row="4" Text="{Binding Path=State.NextTrackingAction.MotorTarget, StringFormat=Motor-Target: {0} mm}" FontWeight="Medium"></TextBlock>
        </Grid>
    </Grid>
</UserControl>
